package com.weareint.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.util.Date;

@Data
public abstract class AbstractEntity<D> implements IBasicEntity<D> {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;

    @TableField("creator")
    private Long creator;

    @TableField("updater")
    private Long updater;

    /**
     * <pre>
     *
     * </pre>
     * @author ${author}
     */
    @Override
    public boolean wasNewObject() {
        return null == id || id <= 0;
    }

}
